﻿namespace NTLib.WPF.Themes
{
    using Application.Themes;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;

    /// <summary>
    /// 
    /// </summary>
    /// <seealso cref="System.Windows.DependencyObject" />
    public sealed class ThemeDictionary : DependencyObject, IThemeDictionary
    {
        #region Fields
        #endregion

        #region Ctor

        /// <summary>
        /// Initializes a new instance of the <see cref="ThemeDictionary"/> class.
        /// </summary>
        public ThemeDictionary()
        {
            this.Id = Guid.NewGuid();
            this.Dictionary = new ThemeResourceDictionary();
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the name of the theme.
        /// </summary>
        public string ThemeName
        {
            get { return (string)GetValue(ThemeNameProperty); }
            set { SetValue(ThemeNameProperty, value); }
        }

        // Using a DependencyProperty as the backing store for ThemeName.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ThemeNameProperty =
            DependencyProperty.Register("ThemeName", typeof(string), typeof(ThemeDictionary), new PropertyMetadata(ThemeManager.DEFAULT));

        /// <summary>
        /// Gets or sets the dictionary.
        /// </summary>
        public IResourceDictionary Dictionary
        {
            get { return (IResourceDictionary)GetValue(DictionaryProperty); }
            set { SetValue(DictionaryProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Dictionary.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty DictionaryProperty =
            DependencyProperty.Register("Dictionary", typeof(IResourceDictionary), typeof(ThemeDictionary), new PropertyMetadata(null));

        /// <summary>
        /// Gets the identifier.
        /// </summary>
        public Guid Id { get; }

        #endregion
    }
}
